/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package boundless.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author hendrikdekock
 */
@Embeddable
public class JoinrequestsPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "USERID")
    private int userid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "LEAGUEID")
    private int leagueid;

    public JoinrequestsPK() {
    }

    public JoinrequestsPK(int userid, int leagueid) {
        this.userid = userid;
        this.leagueid = leagueid;
    }

    public int getUserid() {
        return userid;
    }

    public void setUserid(int userid) {
        this.userid = userid;
    }

    public int getLeagueid() {
        return leagueid;
    }

    public void setLeagueid(int leagueid) {
        this.leagueid = leagueid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) userid;
        hash += (int) leagueid;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof JoinrequestsPK)) {
            return false;
        }
        JoinrequestsPK other = (JoinrequestsPK) object;
        if (this.userid != other.userid) {
            return false;
        }
        if (this.leagueid != other.leagueid) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        //return "boundless.entities.JoinrequestsPK[ userid=" + userid + ", leagueid=" + leagueid + " ]";
        return "Request by user " +userid + " to join league " + leagueid; 
    }
    
}
